<template>
  <el-dialog title="详情" :visible.sync="visible" :close-on-click-modal="false" width="40%" top="10vh">
    <div class="sketch_content">
      <el-form :model="form" label-width="120px" ref="dataForm">
        <el-form-item label="地区名称:">
          <span>{{form.name}}</span>
        </el-form-item>
        <el-form-item label="地区等级:">
          <span v-if="form.level === 1">省</span>
          <span v-if="form.level === 2">市</span>
          <span v-if="form.level === 3">县/区</span>
          <span v-if="form.level === 4">街道</span>
        </el-form-item>
        <el-form-item label="城市名称:">
          <span>{{form.cityName}}</span>
        </el-form-item>
        <el-form-item label="省份名称:">
          <span>{{form.provinceName}}</span>
        </el-form-item>
        <el-form-item label="显示顺序:">
          <span>{{form.orderNum}}</span>
        </el-form-item>
        <el-form-item label="创建时间:">
          <span>{{form.createTime}}</span>
        </el-form-item>
      </el-form>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" icon="el-icon-close" @click.native="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
  export default {
    data () {
      return {
        visible: false,
        form: {}
      }
    },
    methods: {
      init (id) {
        this.form = {}
        this.visible = true
        if (id) {
          this.httpGet(`/sysRegion/info/${id}`).then(res => {
            this.form = res.data
          })
        }
      }
    }
  }
</script>

